package siau.android.base

import siau.android.http.model.*
import io.reactivex.rxjava3.core.Observable
import kotlin.collections.ArrayList

class HttpHelper {

    companion object {
        private const val outerTest = "http://47.99.216.18:18881/"                //内网穿透
        private const val innerTest = "http://192.168.0.17:8881/"            //测试
        private const val prepare = "https://pretest.sevenbubble.com/"      //预发 18
        private const val online = "https://api.sevenbubble.com/"         //线上

        private const val localZ = "http://192.168.0.41:8881/"         //local

        const val baseUrl = innerTest

        fun isOnLine(): Boolean {
            return baseUrl == online
        }

        fun isInnerTest(): Boolean {
            return baseUrl == innerTest
        }

        fun isOuterTest(): Boolean {
            return baseUrl == outerTest
        }

        fun isPrepare(): Boolean {
            return baseUrl == prepare
        }
    }

    fun getCaptcha(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).getCaptcha(any)
    }

    fun smsLogin(any: Any): Observable<LoginResponse>? {
        return InterfaceAPI(baseUrl).smsLogin(any)
    }

    fun passwordLogin(any: Any): Observable<LoginResponse>? {
        return InterfaceAPI(baseUrl).passwordLogin(any)
    }

    fun createFamily(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).createFamily(any)
    }

    fun refreshToken(any: Any): Observable<LoginResponse>? {
        return InterfaceAPI(baseUrl).refreshToken(any)
    }

    fun getDefaultFamily(): Observable<GetDefaultFamilyResponse>? {
        return InterfaceAPI(baseUrl).defaultFamily
    }

    fun getChildHomeData(any: Any): Observable<HomeResponse>? {
        return InterfaceAPI(baseUrl).getChildHomeData(any)
    }

    fun getFootRecord(any: Any): Observable<FootRecordResponse>? {
        return InterfaceAPI(baseUrl).getFootRecord(any)
    }

    fun addChild(any: Any): Observable<ChildIdModel>? {
        return InterfaceAPI(baseUrl).addChild(any)
    }

    fun growTrend(any: Any): Observable<GrowTrendResponse>? {
        return InterfaceAPI(baseUrl).growTrend(any)
    }

    fun listHistory(any: Any): Observable<ArrayList<ListHistoryModel>>? {
        return InterfaceAPI(baseUrl).listHistory(any)
    }

    fun myBabyList(): Observable<ArrayList<ChildModel>>? {
        return InterfaceAPI(baseUrl).myBabyList()
    }

    fun friendList(): Observable<ArrayList<FriendModel>>? {
        return InterfaceAPI(baseUrl).friendList()
    }

    fun deleteHistory(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).deleteHistory(any)
    }

    fun getFamilyList(): Observable<FamilyListResponse>? {
        return InterfaceAPI(baseUrl).familyList
    }

    fun changeFamily(any: Any): Observable<GetDefaultFamilyResponse>? {
        return InterfaceAPI(baseUrl).changeFamily(any)
    }

    fun recordWeight(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).recordWeight(any)
    }

    fun recordHeight(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).recordHeight(any)
    }

    fun recordFootSize(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).recordFootSize(any)
    }

    fun quitFamily(any: Any): Observable<GetDefaultFamilyResponse>? {
        return InterfaceAPI(baseUrl).quitFamily(any)
    }

    fun deleteFamilyMember(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).deleteFamilyMember(any)
    }

    fun deleteChild(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).deleteChild(any)
    }

    fun getChildInfo(any: Any): Observable<ChildModel>? {
        return InterfaceAPI(baseUrl).getChildInfo(any)
    }

    fun editChild(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).editChild(any)
    }

    fun changeIdentity(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).changeIdentity(any)
    }

    fun scanAddFamily(any: Any): Observable<GetDefaultFamilyResponse>? {
        return InterfaceAPI(baseUrl).scanAddFamily(any)
    }

    fun forgetPassword(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).forgetPassword(any)
    }

    fun getUserInfo(): Observable<UserInfoModel>? {
        return InterfaceAPI(baseUrl).userInfo
    }

    fun editUserInfo(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).editUserInfo(any)
    }

    fun setPassword(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).setPassword(any)
    }

    fun changePassword(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).changePassword(any)
    }

    fun getWXInfo(any: Any): Observable<WXLoginResponse>? {
        return InterfaceAPI(baseUrl).getWXInfo(any)
    }

    fun unBindWx(): Observable<Any>? {
        return InterfaceAPI(baseUrl).unBindWx()
    }

    fun bindWx(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).bindWx(any)
    }

    fun getMessageList(any: Any): Observable<MessageListResponse>? {
        return InterfaceAPI(baseUrl).getMessageList(any)
    }

    fun readMark(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).readMark(any)
    }

    fun hideNotify(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).hideNotify(any)
    }

    fun getSystemMessageList(any: Any): Observable<SystemMessageListResponse>? {
        return InterfaceAPI(baseUrl).getSystemMessageList(any)
    }

    fun getBindDeviceList(): Observable<ArrayList<DeviceModel>>? {
        return InterfaceAPI(baseUrl).bindDeviceList
    }

    fun getListType(any: Any): Observable<GetListTypeResponse>? {
        return InterfaceAPI(baseUrl).getListType(any)
    }

    fun getListType2(any: Any): Observable<GetListType2Response>? {
        return InterfaceAPI(baseUrl).getListType2(any)
    }

    fun getQiNiuInfo(): Observable<GetQiNiuInfoResponse>? {
        return InterfaceAPI(baseUrl).qiNiuInfo
    }

    fun changePhone(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).changePhone(any)
    }

    fun clickPushMessage(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).clickPushMessage(any)
    }

    fun downloadResource(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).downloadResource(any)
    }

    fun getUpdateInfo(any: Any): Observable<UpdateModel>? {
        return InterfaceAPI(baseUrl).getUpdateInfo(any)
    }

    fun getAnalyseDates(any: Any): Observable<ArrayList<Long>>? {
        return InterfaceAPI(baseUrl).getAnalyseDates(any)
    }

    fun getAnalyseDate(any: Any): Observable<GetAnalyseDateResponse>? {
        return InterfaceAPI(baseUrl).getAnalyseDate(any)
    }

    fun addDevice(any: Any): Observable<AddDeviceResponse>? {
        return InterfaceAPI(baseUrl).addDevice(any)
    }

    fun unbindDevice(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).unbindDevice(any)
    }

    fun checkCanBindBluetooth(any: Any): Observable<IsExistModel>? {
        return InterfaceAPI(baseUrl).checkCanBindBluetooth(any)
    }

    fun shoeSizeList(): Observable<ArrayList<ShoeSizeListModel>>? {
        return InterfaceAPI(baseUrl).shoeSizeList()
    }

    fun swapShoeSizeType(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).swapShoeSizeType(any)
    }

    fun makeOverFamily(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).makeOverFamily(any)
    }

    fun familyCount(): Observable<FamilyCountModel>? {
        return InterfaceAPI(baseUrl).familyCount()
    }

    fun swapUnit(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).swapUnit(any)
    }

    fun checkAd(): Observable<AdvertisementModel>? {
        return InterfaceAPI(baseUrl).checkAd()
    }

    fun hideAd(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).hideAd(any)
    }

    fun communityActivityDetail(any: Any): Observable<FlutterUrlModel>? {
        return InterfaceAPI(baseUrl).communityActivityDetail(any)
    }

    fun getRemainingTime(any: Any): Observable<GetRemainingTimeResponse>? {
        return InterfaceAPI(baseUrl).getRemainingTime(any)
    }

    fun getBrushList(any: Any): Observable<GetBrushListResponse>? {
        return InterfaceAPI(baseUrl).getBrushList(any)
    }

    fun updateDeviceInfo(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).updateDeviceInfo(any)
    }

    fun updateCid(any: Any): Observable<Any>? {
        return InterfaceAPI(baseUrl).updateCid(any)
    }
}
